from collections import OrderedDict

TYPES = [
    'model',
    'oper',
    'tensor'
]

TEMP = """
digraph {
    /* Note: HTML labels do not work in IE, which lacks support for <foreignObject> tags. */
    node [rx=7 ry=7 labelStyle="font: 300 14px 'Helvetica Neue', Helvetica"]
    edge [labelStyle="font: 300 14px 'Helvetica Neue', Helvetica"]
    %s
}
"""

class Nerual:
    nodes = OrderedDict()
    edges = []
    
    def __init__(self, obj, type='model'):
        self.__class__.nodes[obj]
    
    @classmethod
    def add_age(cls):
        pass
    
    def geti(self, obj):
        pass

    def get_color(self, obj):
        base = 4096 // len(Nerual.nodes)
        
        c = hex(base * self.geti(obj)).replace("0x", "#")
        
        if len(c) < 4:
            c = c + '0'* (4- len(c))
        if len(c_f) < 4:
            c_f = c_f + '0'* (4- len(c_f))
        return c,c_f

    def __repr__(self):
        return TEMP